#!/usr/bin/python
array = []
top = (999) # Highest 3 digit number
bottom = (100) # Lowest 3 digit number

for i in range(bottom, top): # Multiply each number "i" with "x"
	for x in range(bottom, top): # Multiply each number "x" with "i"
		z = i * x
		z = str(z)
		rev = z[::-1]
		if z == rev:
			z = int(z)
			array.append(z)
print max(array)
